const express = require('express');
// 创建一个服务的应用程序
const app = express();

// 定义中间件
const middleware1 = (req,res,next)=>{
    console.log("1");
    next();
    console.log("1-1");
}
const middleware2 = (req,res,next)=>{
    console.log("2");
    next();
    console.log("2-2");
}
const middleware3 = (req,res,next)=>{
    console.log("3");
    next();
    console.log("3-3");
}
app.use('/home',middleware1)
app.use('/home',middleware2)
app.use('/home',middleware3)

app.get('/home', (req,res)=>{
    res.send('我是home')
})

app.get('/login', (req,res)=>{
    res.send('登录成功')
})

app.listen(9527, ()=>{
    console.log('start at port 9527');
})